package com.gitee.wsl.ext.collection

fun <T : Comparable<T>> Iterable<T>.isAscending(): Boolean =
    asSequence().zipWithNext().all { (left, right) -> left < right }

fun <T : Comparable<T>> Iterable<T>.isDescending(): Boolean =
    asSequence().zipWithNext().all { (left, right) -> left > right }